﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BaseArtList.aspx.cs" Inherits="Com.CMS263.Web.manage.ManageBaseArtDesc.BaseArtList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <link href="/manage/css/common.css" rel="stylesheet" type="text/css" />
    <link href="/manage/css/main.css" rel="stylesheet" type="text/css" />
    <link href="/manage/css/box.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" language="javascript" src="/manage/js/jquery-1.4.2.min.js"></script>

    <script type="text/javascript" language="javascript" src="/manage/js/pager.js"></script>

    <script language="javascript" type="text/javascript">
        function del(id, obj) {
            if (confirm('这是一个不可逆的操作，真的要删除此条记录')) {
                $.post("action.aspx", { id: id }, function(data) {
                    if (data == "ok") {
                        alert('删除成功');
                        $(obj.parentNode.parentNode).remove();
                    }
                })
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div class="main">
        <div class="mainMenu">
            <div class="mainMenuList">
                <ul>
                    <li><a href="AddBaseArt.aspx?pid=<%=Request["pid"] %>&menuId=<%=Request["menuId"] %>">
                        <b>添加<%=menuTitle%></b><span></span></a></li>
                    <li class="s"><a><b>
                        <%=menuTitle%>列表</b><span></span></a></li>
                </ul>
            </div>
        </div>
        <div class="mainContent">
            <div class="productSearch">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table1">
                    <tr>
                        <td width="80" class="c">
                            搜索
                        </td>
                        <td width="160" class="c">
                            <asp:TextBox ID="txtKey" runat="server"></asp:TextBox>
                        </td>
                        <td width="80" class="c">
                            <asp:Button ID="Button1" runat="server" Text="搜索" OnClick="Button1_Click" />
                        </td>
                        <td width="160" class="c">
                        </td>
                        <td class="c">
                        </td>
                    </tr>
                </table>
            </div>
            <div class="productList">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table2">
                    <tr>
                        <th width="40" class="c">
                            排序
                        </th>
                        <th class="c">
                            标题
                        </th>
                        <%foreach (Com.CMS263.PO.ExtAttribute attr in eaList)
                          { %>
                        <th class="c">
                            <%=attr.attrTxtName %>
                        </th>
                        <%} %><th class="c">
                            状态
                        </th>
                        <th class="c">
                            操作
                        </th>
                    </tr>
                    <% foreach (Com.CMS263.PO.ArtBase art in artList)
                       { %>
                    <tr>
                        <td class="c">
                            <%=art.orderNum %>
                        </td>
                        <td class="c">
                            <a title="<%=art.title %>">
                                <%=Com.CMS263.Util.StringUtil.GetHtml(art.title,15) %></a>
                        </td>
                        <%
                            foreach (Com.CMS263.PO.ExtAttribute attr in eaList)
                            {
                        %>
                        <td class="c">
                            <%if (attr.attrType == 4)
                              {
                                  if (this.GetExtValueByBaseArtId(art.id, attr.id) != "")
                                  {
                                      Response.Write("<img src='/ArtUpFile/" + this.GetExtValueByBaseArtId(art.id, attr.id) + "' width='100' height='100'/>");
                                  }
                                  else
                                  {
                                      Response.Write("<img src='/ArtUpFile/zwtp.jpg' width='100' height='100'/>");
                                  }
                              }
                              else if (attr.attrType == 2)
                              {
                                  Response.Write("<a title='" + this.GetExtValueByBaseArtId(art.id, attr.id).Replace("'", "’") + "'>" + Com.CMS263.Util.StringUtil.GetText(this.GetExtValueByBaseArtId(art.id, attr.id).Replace("'", "’"), 20) + "</a>");

                              }
                              else if (attr.attrType == 9)
                              {
                                  Response.Write("<a href='" + attr.defaultValue + "&artid=" + art.id + "'>" + attr.attrTxtName + "</a>");
                              }
                              else
                              {
                                  Response.Write("<a title='" + this.GetExtValueByBaseArtId(art.id, attr.id).Replace("'", "’") + "'>" + Com.CMS263.Util.StringUtil.GetText(this.GetExtValueByBaseArtId(art.id, attr.id).Replace("'", "’"), 20) + "</a>");
                              }
                            %>
                        </td>
                        <%} %>
                        <td class="c">
                            <%=art.isBest==0?"正常":"<span style='color:red'>推荐</span>" %>
                        </td>
                        <td class="c">
                            <a href="ModArt.aspx?pid=<%=Request["pid"] %>&id=<%=art.id %>&page=<%=Request["page"] %>&menuId=<%=Request["menuId"] %>">
                                修改</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a style="cursor: pointer" onclick="del(<%=art.id %>,this)">
                                    删除</a><% if (System.Configuration.ConfigurationSettings.AppSettings["isshow"] == "true")
                                             {%>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input value="生成单页代码" type="button" onclick='javascript:window.location.href="/manage/ManageGetTags/gettagssinglebyid.aspx?pid=<%=Request["pid"] %>"' />
                            <%} %>
                        </td>
                    </tr>
                    <%} %>
                    <tr>
                        <td colspan="8">
                            <div style="float: right; margin-right: 100px">
                                <%=GetPager()%></div>
                        </td>
                    </tr>
                    <% if (System.Configuration.ConfigurationSettings.AppSettings["isshow"] == "true")
                       {%>
                    <tr>
                        <td colspan="5" align="center">
                            <input value="生成列表代码" type="button" onclick='javascript:window.location.href="/manage/ManageGetTags/gettagslist.aspx?pid=<%=Request["pid"] %>&menuId=<%=Request["menuId"] %>&state=desc"' />
                        </td>
                    </tr>
                    <% } %>
                </table>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
